<!--
  @author tanghongjun
  @since 2018/10/19 08:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss2">
    <title>服务商库存</title>
    <style>
        /* 表格的可修改效果 */
        .layui-table-box td[data-edit="text"] .layui-table-cell{
            border-radius: 1px;
            border: 1px solid  #d2d2d2;
        }

        .layui-table-box td[data-edit="text"] .layui-table-edit {
            text-align: center;
            top: 3px;
            height: 28px;
            line-height: 28px;
        }
    </style>
</head>
<body>

<div class="layui-fluid">

    <div class="layui-card">

        <div class="layui-split">&nbsp;</div>

        <div style="border-bottom: 1px solid #d9d9d9; line-height: 30px"><span>注意：库存为0，表示不可下单；库存为空（即：不填数字），则表示不限库存；节假日系数不填，则表示为：1</span></div>

        <form method="post" action="/plat/sp/config/list.action" id="product_list">
            <input type="hidden" name="spId" th:value="${vo.spId}"/>
            <div class="layui-form" th:include="orderconfig/orderstock/sp/_query :: query "></div>
        </form>

        <div class="layui-card-body">

            <div th:replace="orderconfig/orderstock/sp/_table::table"></div>

            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button th:if="${#authPermit.checkPermit('/sp/orderStock/batchSet.action')}"  class="layui-btn layui-btn-sm" lay-event="batchSet">批量设置</button>
                    </div>
                </div>
            </script>
        </div>

    </div>

</div>
</body>
</html>
<script type="text/javascript" th:inline="javascript">
    let childIndex;
    var json = {
        spId:[[${vo.spId}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        vo: [[${vo}]],
    };

    layui.config({
        version: 202008041038,
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        spconfig_list_js: "orderconfig/orderstock/sp/zmn.scm.orderstock.spconfig.list",
    }).use(['index', 'spconfig_list_js']);

</script>

<script id="updateStockHtml" type="text/html">
    <form method="POST" action="" class="layui-form" lay-filter="zmn-form-stock">
        <input type="hidden" name="configId" value="{{d.configId}}"/>
        <div class="layui-form-item"></div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">库存量：</label>
            <div class="layui-input-inline" style="width:150px">
                <input type="text" name="stock" placeholder="库存量" value="{{d.stock == '-' ? '' : d.stock}}" oninput="value=value.replace(/[^\d]/g,'');" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input" maxlength="6"/>
            </div>
        </div>
        <div class="layui-form-item submit">
            <div style="text-align: center">
                <button class="layui-btn" lay-submit lay-filter="zmn-form-stock-submit">提交</button>
                <a class="layui-btn layui-btn-primary" onclick="layer.close(childIndex);">取消</a>
            </div>
        </div>
    </form>
</script>